package com.cwvs.services;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cwvs.dao.AppFunctionDao;
import com.cwvs.models.AppFunction;

@Service
public class AppFunctionService {
	@Resource
	private AppFunctionDao appFunctionDao;
	/**
	 * 获取根目录菜单
	 * @return
	 */
	public AppFunction getRoot() {
		return appFunctionDao.getRoot();
	}
	/**
	 * 通过上级ID获取下级
	 * @param parent_id
	 * @return
	 */
	public List<AppFunction> findAppFunctionsByParent(String parent_id) {
		return appFunctionDao.findAppFunctionsByParent(parent_id);
	}
	/**
	 * 获取权限菜单
	 * @param user_id
	 * @param user_name
	 * @return
	 */
    public List<String> allowFunctions(String user_id, String user_name) {
    	return appFunctionDao.allowFunctions(user_id, user_name);
    }
}
